import request from '@/utils/request'

// 查询客户列表
export function fullListCustomer(query) {
  return request({
    url: '/crm/customer/fullList',
    method: 'get',
    params: query
  })
}

export function myListCustomer(query) {
  return request({
    url: '/crm/customer/myList',
    method: 'get',
    params: query
  })
}
export function auditListCustomer(query) {
  return request({
    url: '/crm/customer/auditList',
    method: 'get',
    params: query
  })
}


// 下载用户导入模板
export function importTemplate() {
  return request({
    url: '/crm/customer/importTemplate',
    method: 'get'
  })
}



// 查询客户详细
export function getCustomer(customerId) {
  return request({
    url: '/crm/customer/' + customerId,
    method: 'get'
  })
}
export function getCustomerInfo(customerId,type) {
  return request({
    url: '/crm/customer/getCustomerInfo/' + customerId+"/"+type,
    method: 'get'
  })
}


// 新增客户
export function addCustomer(data) {
  return request({
    url: '/crm/customer',
    method: 'post',
    data: data
  })
}
export function auditCustomer(data) {
  return request({
    url: '/crm/customer/auditCustomer',
    method: 'post',
    data: data
  })
}



// 修改客户
export function updateCustomer(data) {
  return request({
    url: '/crm/customer',
    method: 'put',
    data: data
  })
}

// 删除客户
export function delCustomer(customerId) {
  return request({
    url: '/crm/customer/' + customerId,
    method: 'delete'
  })
}

// 导出客户
export function exportCustomer(query) {
  return request({
    url: '/crm/customer/export',
    method: 'get',
    params: query
  })
}


export function receive(data) {
  return request({
    url: '/crm/customer/receive',
    method: 'post',
    data: data
  })
}

export function recover(data) {
  return request({
    url: '/crm/customer/recover',
    method: 'post',
    data: data
  })
}

export function assign(data) {
  return request({
    url: '/crm/customer/assign',
    method: 'post',
    data: data
  })
}


